public class trye {
    public static boolean teue(){
        Node root=new Node();
        return trye(root)!=0;
    }
//    是否为平衡二叉树
    public static int trye(Node root){
        if (root==null){
            return 0;
        }
        int a=trye(root.left)+1;
        int b=trye(root.right)+1;
        if (a==0||b==0){
            return -1;
        }
        if ((a>b?a:b)-(a<b?a:b)<=1){
            return (a>b?a:b);
        }else {
            return -1;
        }

    }
}
